using System;

public class RedstoneStringBlock : BlockMaterial
{
    public RedstoneStringBlock() : base("redstone_string")
    {
        DisPlayName = "红石线";
        StateMax = 64;
        UpdataBlockEvent = Tick;
    }
    public void Tick(UpdataTickEvent e)
    {
        e.block.SetState(e.GetAngle<BlockEntity>(true));
    }

    public override int GetTileId(BlockData block)
    {
        if (block.power <= 0) return id + block.State;
        else if (block.power < 4) return id + block.State + 16;
        else return id + block.State + 16 * (block.power / 4);
    }
}